import request from './request'
import qs from 'qs'

export const JingPinAPI = () => request.get("/products/recommend")

export const HotAPI = () => request.get("/products/hot")

export const SendSMSAPI = (params) => request.post("/sendSMS",qs.stringify(params));

export const PhoneReginAPI = (params) => request.post("/phoneRegin",qs.stringify(params));

export const WeiXinLoginAPI = (params) => request.post("/wechatUsers/PCLogin",qs.stringify(params));

export const BinDingAPI = (params) => request.post("/wechatUsers/binding",qs.stringify(params));

export const UserProfilesAPI = () => request.get("/shop/userProfiles");

export const  GoodDetailsAPI = (id) => request.get(`/products/${id}`);

export const AddToCartAPI = (params) => request.post("/shop/carts/add",qs.stringify(params))

export const GoodsSearchAPI = (params) => request.get("/products",{
    params
})

export const CartsAPI = () => request.get("/shop/carts");

export const  GoodsDelAPI = (id) => request.delete(`/shop/carts?productIds=${id}`);